﻿using System;
using System.Collections.Generic;
using Color = System.Drawing.Color;
using SwinGame;
using System.Diagnostics;

namespace Jumpman.src
{
    public class MoveAction:IAction
    {
        private string direction;
        




        public MoveAction(String dir)
        {
            direction = dir;

        }
        public void DoAction(GameController gc)
        {
            
            switch (direction)
            {
                case "left":


                    if (Camera.CameraX() - 10 >= 0 )
                    {

                        gc.Player.ElementSprite.Velocity.X = -5;
                        gc.Player.ElementSprite.UpdateAnimation();

                    }
                    else
                    {
                        gc.Player.ElementSprite.Velocity.X = 0;
                    }
                    break;
                case "right":

                        gc.Player.ElementSprite.UpdateAnimation();
                        gc.Player.ElementSprite.Velocity.X = 5;
                        
                    break;
            }
        }



    }
}
